package com.qidian.mes.controller;

import com.qidian.mes.pojo.RouteProduct;
import com.qidian.mes.service.RouteProductService;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



@RestController
@RequestMapping("/routeProduct")
@CrossOrigin
public class RouteProductController {
    @Autowired
    private RouteProductService routeProductService;
    @GetMapping("/list")
    public MESResult list(Long routeId){
        return routeProductService.list(routeId);
    }
    @DeleteMapping("/delete")
    public MESResult delete(Long recordId){
        return routeProductService.delete(recordId);
    }
    @PostMapping("/save")
    public MESResult save(@RequestBody RouteProduct routeProduct){
        return routeProductService.save(routeProduct);
    }

    @GetMapping("/get")
    public MESResult get(Long recordId){
        return routeProductService.selectByRecordId(recordId);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody RouteProduct routeProduct){
        return  routeProductService.update(routeProduct);
    }
}
